#ifndef BASEWIDGET_H
#define BASEWIDGET_H

#include <QWidget>
#include "config.h"
#include <keythread.h>
#include <QMouseEvent>
#include <QTimer>

#include "loading.h"

class BaseWidget : public QWidget
{
    Q_OBJECT
public:
    explicit BaseWidget(QWidget *parent = nullptr);
    ~BaseWidget();

    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *)override;
    bool isloading = true;
    Loading *loading;
    QPoint pressPos;

    bool isMove = false;
    bool isPress = false;
    QTimer *timer;
public slots:
    virtual void KeyEvent(Key_t, int)=0;

signals:
    void sigClose();
    void sigLongPress();
};

#endif // BASEWIDGET_H
